














#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSUInteger, YHIAPPurchType) {
    


    IAPPurchSuccess = 0,
    


    IAPPurchFailed = 1,
    


    IAPPurchCancel = 2,
    


    IAPPurchVerFailed = 3,
    


    IAPPurchVerSuccess = 4,
    


    IAPPurchNotArrow = 5,
    


    IAPPurchRestored = 6,
};

typedef void (^YHIAPCompletionHandle)(YHIAPPurchType type, NSData *data);


@interface YHIAPManager : NSObject

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (id)copy NS_UNAVAILABLE;
- (id)mutableCopy NS_UNAVAILABLE;

+ (YHIAPManager *)sharedInstance;

- (void)startPurchaseWithProductId:(NSString *)productId
                           orderId:(NSString *)orderId
                    completeHandle:(YHIAPCompletionHandle)completeHandle;

@end

NS_ASSUME_NONNULL_END
